<template>
	<b>这个是children4组件</b> <br>
	<b>这是个子组件</b>
	<view style="color: #ff0000;">
		{{str}}
	</view>
	<view style="color: #ff0000;">
		来自父组件双向绑定的值 {{num}}
	</view>
	<button @click="change">直接修改父组件传给子的值</button>
	<hr>
	<grandchild1/>
</template>

<script setup>
	name:'children3'
	import {ref,defineEmits,defineProps} from 'vue'
	import emitter from '@/plugins'  
	let str=ref('')
	emitter.on('fn',e=>{
		str.value=e.value
	})
	defineProps(['num'])
	const emits=defineEmits(['update:num'])
	function change(){
		emits('update:num',9999)
	}
</script>

<style>
</style>